<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/lib/vue.min.js"></script>
        <script src="js/lib/vue-resource.js"></script>	
		<link rel="stylesheet" href="css/lib/bootstrap.min.css" />
		<link rel="stylesheet" href="js/themes/default/easyui.css" />
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>		
	</head>
	<style>
		body{
			font-size:12px;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:left;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: left;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	</style>
	<body>
		<div class="">
			<div id="sho"></div>
		<!--第三个查询请求-->
		<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px" id="box">
			<table class="table table-hover" style="width:50%;float:left;">				
					<tr>
						<th style="font-size:30px;" colspan="10">刷卡费率</th>
					</tr>
					<tr>						
						<td class="text-left">通道名称</td>
						<td class="text-left">刷卡费率</td>
						<td class="text-left">单笔手续费</td>
						<td class="text-left">额外费用</td>
						<td class="text-left">修改</td>
					</tr>
					<tr v-for="item in list" v-show="item.status==1">
						
						<td class="text-left">{{item.name+"+"+item.channelParams}}</td>
						
						<td  class="text-left" contenteditable="true">
												{{(item.rate*100).toFixed(2)}}%
							
							</td>
						<td class="text-left">{{item.withdrawFee}}</td>
						<td class="text-left">{{item.extraFee}}</td>	
						<td class="text-left"><button class="btn btn-default" @click="add(item)">修改费率</button></td>
					</tr>
					<tr>
						<td colspan="10" id="show02" class="text-left" style="display:none;">
						</td>
					</tr>				
			</table>
			<table class="table table-hover" style="width:50%;float:right;">				
					<tr>
						<th style="font-size:30px;" colspan="10">刷卡费率</th>
					</tr>
					<tr>						
						<td class="text-left">通道名称</td>
						<td class="text-left">刷卡费率</td>
						<td class="text-left">单笔手续费</td>
						<td class="text-left">额外费用</td>
						<td class="text-left">修改</td>
					</tr>
					<tr v-for="item in list" v-show="item.status==1">
						
						<td class="text-left">{{item.name+"+"+item.channelParams}}</td>
						
						<td  class="text-left" contenteditable="true">
												{{(item.rate*100).toFixed(2)}}%
							
							</td>
						<td class="text-left">{{item.withdrawFee}}</td>
						<td class="text-left">{{item.extraFee}}</td>	
						<td class="text-left"><button class="btn btn-default" @click="add(item)">修改费率</button></td>
					</tr>
					<tr>
						<td colspan="10" id="show02" class="text-left" style="display:none;">
						</td>
					</tr>				
			</table>
		</div>
		</div>
	</body>
	<script>		
		$(function(){
			 new Vue({
			 		    el:"#box",
			            data: {
			                list:[],
			                token:""
			            },
			            created:function(){/*生命周期函数*/
			            	var data={
								thirdLevelId:0,
								access_type:0,
								brand_id:2					
							};
			                this.$http.post(window.baseUrl+"user/thirdlevel/rate/query/thirdlevelid",data,{emulateJSON:true}).then(
			                    function (res){
			                        console.log(res);
			                        console.log(res.data.result);			                        
			                            this.list = res.data.result			                        			                        
			                    },function (res) {
			                        /*console.log(res);*/
			                        /*alert("查询失败,请重试！")*/
			                    }
			                );
			            },
			            methods:{

			            }

			 })
		})
	</script>
	<script>
		
	  //       app.controller('customersCtrl', function($scope, $http ){
	  //       	var userid = sessionStorage.getItem(key=13); 
			// 	$('#f1').val(userid);
			// 	/*根据用户编号展示所有平台信息和费率*/
			// 	$http({
			// 		method: 'POST',
			// 		params: {user_id:userid},
			// 		url: 'http://ds.jiepaypal.cn:80/v1.0/user/channel/query/all/brandid'
			// 	}).then(function successCallback(data){
			// 			console.log("请求数据成功...");
			// 			console.log(data.data.result);
			// 			$scope.items2 = data.data.result
			// 	}, function errorCallback(data) {
			// 			console.log("请求数据失败...");
			// 	     	console.log(data)
			// 	});
			// 	/*修改用户刷卡费率*/
			// 	$scope.add = function(item){                   
			// 	    console.log(item);
   //                  var userid = sessionStorage.getItem(key=13);
			// 		var id = item.id;
			// 		var rate = item.rate;
			// 		console.log(userid);
			// 	    console.log(id);
			// 	    console.log(rate);
   //                  $http({
   //                      method: 'POST',
   //                      params: {
   //                          user_id:userid,
   //                          channel_id:id,
   //                          rate:rate
   //                      },
   //                      url: 'http://ds.jiepaypal.cn:80/v1.0/user/channel/rate/update/userid'
   //                  }).then(function successCallback(data){
   //                      console.log("修改数据成功...");
   //                      console.log(data.data.result);
   //                      if(data.data.resp_code == 000000)
   //                      alert("成功设置【"+item.name+item.channelParams+"】通道刷卡费率为"+item.rate);
			// 			if(data.data.resp_code == 999999)
			// 			alert(data.data.resp_message);	

   //                  }, function errorCallback(data) {
   //                      console.log("修改数据失败...");
   //                      console.log(data)
   //                  })
   //              }
			// });
	</script>
</html>




